<template>
  <view class="content">
    <view class="header">
      <view class="title">欢迎来到</view>
      <view class="title">悦码本地生活</view>
    </view>
    <view class="nav_item" @click="scanCode">
      <image src="/static/logos.png" class="logo"></image>
      <image src="../../static/sys.png" class="sys"></image>
      <view class="s_text">请扫描二维码进行购物</view>
    </view>
  </view>
</template>
<script lang="ts" setup>
function scanCode() {
  uni.scanCode({
    onlyFromCamera: false,
    success: (res) => {
      console.log(res);
      uni.switchTab({ url: '/' + res.path });
    }
  });
}
</script>
<style scoped lang="scss">
.content {
  width: 686rpx;  
  background: #ffffff;
  border-radius: 16rpx 16rpx 16rpx 16rpx;
  margin: 0 auto;
  .header {
    margin-top: 120rpx;
    .title {
      color: #333;
      font-size: 48rpx;
      font-family: Microsoft YaHei-Regular, Microsoft YaHei;
      font-weight: 400;
      text-align: center;
    }
  }
  .nav_item {
    width: 686rpx;
    height: 758rpx;
    background: #ffffff;
    border-radius: 16rpx 16rpx 16rpx 16rpx;
    margin: 0 auto;
    margin-top: 60rpx;
    position: relative;
    padding-top: 212rpx;
    box-sizing: border-box;
    .logo {
      width: 240rpx;
      height: 240rpx;
      margin-right: 10rpx;
      display: block;
      border-radius: 50%;
      margin: 20rpx auto;
      position: absolute;
      top: -40rpx;
      left: 30rpx;
    }

    .sys {
      width: 400rpx;
      height: 320rpx;
      margin: 0 auto;
      display: block;
    }
    .s_text {
      font-size: 40rpx;
      font-family: Microsoft YaHei-Regular, Microsoft YaHei;
      font-weight: 400;
      color: #3d3d3d;
      text-align: center;
      margin-top: 90rpx;
    }
  }
}
</style>
